<?php if (!defined('THINK_PATH')) exit();?><div class="row" style="margin-bottom: 10px;">
    <div class="col-md-8" style="text-align: left;">
<!--         <a class="btn btn-primary" href="javascript:;"  onclick="return_main()"  >返回主菜单</a>
        &nbsp;&nbsp;
        <a class="btn btn-primary" href="javascript:;"  onclick="return_up()"  >返回上一页</a>
        &nbsp;&nbsp; -->
        <a class="btn btn-primary" href="javascript:;" onclick="_es_openDilogMiddle2('<?php echo U('Nav/add_nav_group',array('is_add'=>0));?>','新增权限组','xinzengquanxianzu')">新增权限组</a>
    </div>
    <div class="col-md-4" style="line-height: 35px;text-align: right;">&nbsp;&nbsp;
        权限组名：<input type="text" name="title" value="<?php echo ($title); ?>" >&nbsp;&nbsp;<a href="javascript:;" onclick="load()" class="btn btn-default btn-sm">搜索</a>
    </div>

</div>
<table class="table table-bordered" id="tbmain">
    <thead>
        <tr>
            <th>菜单名称</th>
            <!--   <th>菜单地址</th> -->
            <th>状态</th>
            <!--  <th>显示状态</th> -->
            <!-- <th>排序</th> -->
            <th width="28%">操作</th>
        </tr>
    </thead>
    <tbody>
        <?php if(!empty($lists['lists'])): if(is_array($lists['lists'])): $i = 0; $__LIST__ = $lists['lists'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$m): $mod = ($i % 2 );++$i;?><tr>
                    <td style="text-align: center;"><a href="javascript:;" onclick="toParentChilder(<?php echo ($m['id']); ?>)" ><?php echo ($m['name']); ?></a></td>
                    <!--    <td><?php echo ($m['name_url']); ?></td> -->
                    <td>
                        <?php if($m['is_enable'] == 1): ?>有效
                            <?php else: ?>
                            无效<?php endif; ?>
                    </td>
<!--             <td>
                <?php if($m['is_menu'] == 1): ?>显示
                    <?php else: ?>
                    不显示<?php endif; ?>
            </td> -->
            <!-- <td><?php echo ($m['sort']); ?></td> -->
            <td>
               <!--  <a href="javascript:;" onclick="_es_openDilogMiddle2('<?php echo U('Nav/add_menu',array('is_add'=>0,parent_id=>$m['id']));?>','新增子菜单','xinzengzidancai')" class="btn btn-info btn-sm">新增子菜单</a>&nbsp;
               <a href="javascript:;" onclick="toParentChilder(<?php echo ($m['id']); ?>)"  class="btn btn-info btn-sm">查看子菜单</a>&nbsp; -->
               <a href="javascript:;" onclick="_es_openDilogMiddle2('<?php echo U('Nav/add_nav_group',array('id'=>$m['id'],'is_add'=>1));?>','编辑权限组','bianjiquanxianzu')" class="btn btn-success btn-sm">编辑</a>
               &nbsp;
               <a href="javascript:;" onclick="delete_ok(<?php echo ($m['id']); ?>)" class="btn btn-danger  btn-sm">删除</a>

           </td>
       </tr><?php endforeach; endif; else: echo "" ;endif; ?>
   <?php else: ?>
   <tr>
    <td colspan="7" align="center">暂无数据!</td>
</tr><?php endif; ?>

</tbody>
</table>
<table style="width: 100%;">
    <tr>
        <td style="text-align: right;"> <div class="page_list_ops dataTables_paginate paging_bootstrap pagination" ><?php echo ($lists['page_html']); ?></div></td>
    </tr>
</table>

<script type="text/javascript">
    $(function(){
        $("#tbmain tr").hover(function(){
            $(this).css({"background-color":"rgba(243, 236, 236, 0.72)"});
        },function(){
            $(this).css({"background-color":"#fff"});
        });
    });

    function load(){
        goSearch("#searchForm","order_list_item_content");
    }

    function _es_openDilogMiddle2(url, title,id) {
     art.dialog.open(url, { title: title, width: '800px', height: '500px', opacity: 0.2, id: id, fixed: true,lock: true, close:function(){load();}  });
}

</script>